# -*- codeing = utf-8 -*-
# @Time : 2021/3/20 0020 12:13
# @Author : Alan Franklin
# @File : UI_globalstack.py
# @Software: PyCharm
class Node(object):
    def __init__(self, val):
        self.val = val
        self.next = None


class GlobalStack(object):
    def __init__(self):
        self.top = None

    def QuiryTop(self):
        if self.top is None:
            return None
        else:
            return self.top

    def Push(self, n):
        node = Node(n)
        node.next = self.top
        self.top = node

    def Pop(self):
        if self.top is None:
            return None
        else:
            tmp = self.top.val
            self.top = self.top.next
            return tmp

class gs:
    mystack = GlobalStack()